/*
 * Copyright 2011 Drew Wilder-Goodwin
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
#ifndef TAB_H_
#define TAB_H_

#include "resources.h"
#include <windows.h>
typedef VOID(*TabResizeCallback) (HWND hWnd, RECT newDisplayArea);
typedef struct {
    HWND hTab;
    RECT lastDisplayArea;
    TabResizeCallback resizeCallback;
} Tab;
typedef struct {
    Tab *tabs;
    int tabCount;
    int current;
    RECT displayArea;
} TabControl;

/*
 * Initialize a Tab
 */
VOID tab_initialize(Tab * tab, HWND hTab,
                    TabResizeCallback resizeCallback);

/*
 * Initialize a TabControl
 */
VOID tab_control_initialize(TabControl * tc, Tab * tabs, int tabCount);

/*
 * Cause a TabControl to redisplay.  Used whenever
 * a new tab is selected or the display area has changed.
 *
 * @param selected The index of the selected tab.  If negative,
 *      a redisplay may be necessary.
 */
VOID tab_control_display(TabControl * tc, int selected);

#endif                          /* TAB_H_ */
